// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import '../static/js/jQuery.js' 
import  '../static/js/jquery.table2excel.js'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import axios from 'axios';
import VueCookie from 'vue-cookie'
import "babel-polyfill";

Vue.config.productionTip = false
Vue.prototype.$http = axios;

Vue.use(ElementUI)
Vue.use(VueCookie)
router.afterEach((to, from, next) => {
    if(to.fullPath.indexOf('automatic') > -1) {
        sessionStorage.setItem('sideBar', 2);
    }else if (to.fullPath.indexOf('BaseSetting') > -1) {
        sessionStorage.setItem('sideBar', 0);
    }else {
        sessionStorage.setItem('sideBar', 1);
    }
    //排课规则回退选中
    if(to.fullPath.indexOf('ScheduleTime') > -1) {
        sessionStorage.setItem('courseInx', 0 )
    } else if (to.fullPath.indexOf('EvenChurch') > -1) {
        sessionStorage.setItem('courseInx', 1 )
    }else if (to.fullPath.indexOf('WorkTogether') > -1) {
        sessionStorage.setItem('courseInx', 2 )
    }else{
        sessionStorage.setItem('courseInx', 3 )
    }

})

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');
